/*
 * Powered By [rapid-framework]
 * Web Site: http://www.rapid-framework.org.cn
 * Google Code: http://code.google.com/p/rapid-framework/
 * Since 2008 - 2012
 */

package com.tech15.pub.model;

import javax.persistence.*;

import org.hibernate.annotations.GenericGenerator;

import javax.validation.constraints.*;
import org.hibernate.validator.constraints.*;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import java.util.*;

import javacommon.base.*;
import javacommon.util.*;

import cn.org.rapid_framework.util.*;
import cn.org.rapid_framework.web.util.*;
import cn.org.rapid_framework.page.*;
import cn.org.rapid_framework.page.impl.*;

import com.tech15.pub.model.*;
import com.tech15.pub.dao.*;
import com.tech15.pub.service.*;
import com.tech15.pub.vo.query.*;

/**
 * @author 胡作正 email:zuozhenghu@sina.com
 * @version 1.0
 * @since 1.0
 */


@Entity
@Table(name = "MEETING_USER")
public class MeetingUser extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "会议人员";
	public static final String ALIAS_MUID = "序号";
	public static final String ALIAS_USERID = "用户id";
	public static final String ALIAS_MID = "会议id";
	
	//date formats
	

	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
    /**
     * 序号       db_column: MUID 
     */ 	
	
	private Long muid;
    /**
     * 用户id       db_column: USERID 
     */ 	
	
	private Long userid;
    /**
     * 会议id       db_column: MID 
     */ 	
	
	private Long mid;
	//columns END


	public MeetingUser(){
	}

	public MeetingUser(
		Long muid
	){
		this.muid = muid;
	}

	

	public void setMuid(Long value) {
		this.muid = value;
	}
	
	@Id @GeneratedValue(generator="custom-id")
	@GenericGenerator(name="custom-id", strategy = "increment")
	@Column(name = "MUID", unique = true, nullable = false, insertable = true, updatable = true, length = 22)
	public Long getMuid() {
		return this.muid;
	}
	
	@Column(name = "USERID", unique = false, nullable = true, insertable = true, updatable = true, length = 22)
	public Long getUserid() {
		return this.userid;
	}
	
	public void setUserid(Long value) {
		this.userid = value;
	}
	
	@Column(name = "MID", unique = false, nullable = true, insertable = true, updatable = true, length = 22)
	public Long getMid() {
		return this.mid;
	}
	
	public void setMid(Long value) {
		this.mid = value;
	}
	
	

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Muid",getMuid())
			.append("Userid",getUserid())
			.append("Mid",getMid())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getMuid())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof MeetingUser == false) return false;
		if(this == obj) return true;
		MeetingUser other = (MeetingUser)obj;
		return new EqualsBuilder()
			.append(getMuid(),other.getMuid())
			.isEquals();
	}
	
	private String username;

	@Transient
	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}
	
}

